/*
 * @Description: 全宗 service
 * @Author: Rfan
 * @Date: 2022-12-05 17:00:35
 * @LastEditTime: 2022-12-06 10:32:12
 */

import Fonds from './entities/fond';
import { fetchFondsListByUnitId } from '@/api/fonds';
import { Key } from 'react';
import { IFond } from '@/interfaces/fond';

class FondService {
  /**
   * 获取全宗列表
   */
  static getFondList(unitId: Key) {
    return fetchFondsListByUnitId(unitId).then((res) => {
      const { data } = res;
      return data.map((item: IFond) => new Fonds(item));
    });
  }
}

export default FondService;
